﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyEagle : Enemy
{
    // Start is called before the first frame update
    protected override void Start()
    {
        base.Start();
    }

    // Update is called once per frame
    void Update()
    {
        Movement();
    }

    public override void Movement()
    {
        if(dirction)
        {
            if (transform.position.y > APosition.y)
            {
                dirction = false;
            }

            rb.velocity = new Vector2(rb.velocity.x, speed);
        }
        else
        {
            if(transform.position.y < BPosition.y)
            {
                dirction = true;
            }

            rb.velocity = new Vector2(rb.velocity.x, -speed);
        }
    }

    public override void SwitchDirction()
    {
        //base.SwitchDirction();
    }
}
